package xj.graph2d.shapes;

import java.awt.Graphics2D;
import java.awt.geom.Point2D;

public interface PolyShapeBase {

  /** (x, y) is the starting, i.e. anchor, point of the polyshape */
  public float getX();

  public float getY();

  public void setFirst(float x, float y);

  public void setStart(float x, float y);

  /** add a new point at the end, coincide with the current last point */
  public void addPoint();

  /** add a new point at the end, (x, y) is absolute */
  public void addPoint(float x, float y);

  /**
   * add a new point at the end. adj == true: (x, y) is absolute, needs to
   * be adjusted to be relative to the starting point adj == false: (x, y)
   * is relative to the starting point
   */
  public void addPoint(float x, float y, boolean adj);

  /**
   * move only the anchor vertex, all other vertices remain in the same
   * location
   */
  public void moveStartOnly(float dx, float dy);

  /** move the i-th vertex by (dx, dy) */
  public void moveVertex(int i, float dx, float dy);

  /** move the i-th vertex to (x, y), absolute coord */
  public void setPoint(int i, float x, float y);

  public Point2D getPoint(int i);

  public java.util.List getPoints();

  /** add a new point at the i-th position, (x, y) is absolute */
  public void addPoint(int i, float x, float y);

  /**
   * add a new point at the i-th position. adj == true: (x, y) is
   * absolute, needs to be adjusted to be relative to the starting point
   * adj == false: (x, y) is relative to the starting point
   */
  public void addPoint(int i, float x, float y, boolean adj);

  public void copyPointsTo(PolyShape s);

  public void removePoint(int i);

  public void setLast(float x, float y);

  public void drawPolyLine(Graphics2D g2);

  public Point2D getLast();

  public int getNumberOfPoints();

  public void scaleFirstLast(float x1, float y1, float x2, float y2);

  public void scaleFirstLast(float x1, float y1, float x2, float y2, boolean limit);
}
